﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using KPIS.GERP.GHRMS.BLL;
using KPIS.GERP.GHRMS.IBLL;
using Telerik.Web.UI;
using System.Globalization;
using System.Web.UI.HtmlControls;

namespace KPIS.GERP.GHRMS.APP.App_UI.Forms
{



    public partial class WF_FinanceInfo : System.Web.UI.Page
    {
        private SsMng ssMng = new SsMng();

        protected void Page_Load(object sender, EventArgs e)
        {

            if (!IsPostBack)
            {


                LoadDataGrid();
            }


        }
        public void LoadDataGrid()
        {

            try
            {
                DataTable dt;
                WelfareFinanceBLL obj = new WelfareFinanceBLL();
                dt = obj.Select();

                RadGrid2.DataSource = dt;
                RadGrid2.DataBind();
            }
            catch (Exception ex)
            {

            }

        }



        protected void RadGrid2_ItemCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
        {


            if (e.CommandName == "btnClick")
            {
                return;
            }

            if (e.CommandName == "Delete")
            {
                int seq = Convert.ToInt32((e.Item as GridDataItem).OwnerTableView.DataKeyValues[e.Item.ItemIndex]["finance_seq"]);

                WelfareFinanceBLL obj = new WelfareFinanceBLL();
                obj.Delete(seq, ssMng.EmpSeqI);
            }
            LoadDataGrid();
        }

        protected void RadGrid2_ItemDataBound(object sender, GridItemEventArgs e)
        {


        }


        protected void RadGrid2_NeedDataSource(object source, GridNeedDataSourceEventArgs e)
        {

        }


        }    
}